package com.bwie.controller;

import com.bwie.service.TbDictService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 军哥
 * @version 1.0
 * @description: TODO
 * @date 2025/7/22 18:42
 */

@RestController
@RequestMapping(value = "/prod/dict")
public class TbDictController {

    @Autowired
    TbDictService tbDictService;

    /**
     * @description 获取字典分页列表
     * @params [pageInfoVo]
     * @return com.bwie.utils.R
     * @author 军哥
     * @date 2025/7/22 18:45
     */
    @PostMapping(value = "/getDictList")
    public R getDictList(@RequestBody PageInfoVo pageInfoVo) {
        return tbDictService.getDictList(pageInfoVo);
    }

    /**
     * @description 根据字典类型，获取字典列表
     * @params [typeId]
     * @return com.bwie.utils.R
     * @author 军哥
     * @date 2025/7/22 19:05
     */
    @PostMapping(value = "/getDictListByTypeId/{typeId}")
    public R getDictListByTypeId(@PathVariable(value = "typeId") Integer typeId) {
        return tbDictService.getDictListByTypeId(typeId);
    }

}
